<include file="Public:header" />
<include file="Public:menu" />

<div  id="main_content_wrap" class="container_12">
  <div class="container_12 boxbody">
  <h2>
    添加业绩
    <a href="{:U('Yeji/index')}" style="position: absolute;right: 10%;background-color: #6f97e9"class="button fr mr10">返回业绩列表</a>
  </h2>
  <form action="{:U('Yeji/done')}" method="post" id="checkAdminForm"  name="myform" enctype="multipart/form-data">
    <p>
      <label>用户：</label>
      <input type="number" value="{$thisyeji}" name="phone" placeholder="填写用户手机号"  class="text small"/>
    </p>
    <p>
      <label>金额：</label>
      <input type="number" value="" name="money"  class="text small" />
    </p>
    <p>
      <label>备注：</label>
      <input type="text" value="" name="beizhu"  class="text small" maxlength="15" />
    </p>
    <p class='tac'>
      <input type="button" class="submit" value="保存" onclick="checkthis_add()" />
    </p>
    </form>
    </div>
</div>
<script>
  function checkthis_add() {
    var phone = document.myform.phone.value;
    var money = document.myform.money.value;
    if (phone == '') {
      alert('请填写用户手机号');
    }else if(phone.length != 11){
      alert('手机号格式不正确');
    }
    else if (money == '') {
      alert('请填写金额')
    }else if(money < 0){
      alert('金额不合法，请重新输入')
    }
    else {
      document.myform.submit();//button按钮实现提交 方法
    }

  }
</script>
<include file="Public:footer" />